package com.shiwaixiangcun.monitor.domain;


import com.rabbit.spring.data.domain.BaseEntity;
import com.shiwaixiangcun.monitor.enums.WorkOrderServiceType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Type;

import javax.persistence.*;

/**
 * 工单服务记录
 *
 * @author ly
 */

@Entity
@Table(name = "ms_work_order_service_record")
@DynamicUpdate
@DynamicInsert
public class WorkOrderServiceRecord extends BaseEntity<Long> {

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "work_order_id")
    private WorkOrder workOrder;

    @Enumerated(EnumType.STRING)
    private WorkOrderServiceType workOrderServiceType;

    @ManyToOne
    @JoinColumn(name = "user_id")
    private User user;

    @Type(type = "text")
    private String content;

    public WorkOrderServiceRecord() {
    }


    public WorkOrder getWorkOrder() {
        return workOrder;
    }

    public void setWorkOrder(WorkOrder workOrder) {
        this.workOrder = workOrder;
    }

    public WorkOrderServiceType getWorkOrderServiceType() {
        return workOrderServiceType;
    }

    public void setWorkOrderServiceType(WorkOrderServiceType workOrderServiceType) {
        this.workOrderServiceType = workOrderServiceType;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
}
